#include "deletedialog.h"
#include "ui_deletedialog.h"

DeleteDialog::DeleteDialog(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::DeleteDialog)
{
    ui->setupUi(this);

    this->setWindowFlags(Qt::FramelessWindowHint);    //无边框
    this->setStyleSheet("outline: none;");            //无虚线框
}

DeleteDialog::~DeleteDialog()
{
    delete ui;
}

void DeleteDialog::initFileName(QString name)
{
    fileName = name;

    ui->msgLabel_2->setText(fileName);
}

void DeleteDialog::changeLanguage()
{
    ui->retranslateUi(this);
}

void DeleteDialog::on_sureBtn_clicked()
{
    if(fileName != "")
    {
        emit deleteFile(fileName);
    }
    this->hide();
}

void DeleteDialog::on_cancelBtn_clicked()
{
    this->hide();
}
